package com.qpf.mycms.api.exception;

import cn.hutool.core.util.StrUtil;
import com.qpf.mycms.api.exception.enums.BusinessExceptionEnum;
import com.qpf.mycms.api.exception.enums.ClientExceptionEnum;
import com.qpf.mycms.api.exception.enums.RemoteExceptionEnum;
import lombok.Getter;

@Getter
public class SystemException extends ServiceException{

    public SystemException(ClientExceptionEnum exceptionEnum, Object... params) {
        super(StrUtil.format(exceptionEnum.getDesc(), params), exceptionEnum.getCode());
    }
    public SystemException(BusinessExceptionEnum exceptionEnum, Object... params) {
        super(StrUtil.format(exceptionEnum.getDesc(), params), exceptionEnum.getCode());
    }
    public SystemException(RemoteExceptionEnum exceptionEnum, Object... params) {
        super(StrUtil.format(exceptionEnum.getDesc(), params), exceptionEnum.getCode());
    }
}
